package com.recruit.wechat.controller;


import com.recruit.wechat.controller.model.ApiResultModel;
import org.springframework.web.bind.annotation.RequestMapping;
import com.recruit.wechat.bean.result.ResultPage;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ResponseBody;

import com.recruit.wechat.bean.WechatEvaluate;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LF
 * @since 2020-08-25
 */
@Controller
@RequestMapping("/WeChatUser/wechatEvaluate")
public class WechatEvaluateController extends BaseController{
     /** 主页面 */
    @RequestMapping("admin/main.html")
    public String main(){
       return  "wechatEvaluate/WechatEvaluateMain";
    }
    /** 添加页面跳转
     * @return 返回页面
     */
    @RequestMapping(value = "admin/addWechatEvaluateHtml")
    public String addWechatEvaluateHtml( ){
             return "wechatEvaluate/WechatEvaluateAdd";
    }
    /** 编辑页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "admin/editWechatEvaluateHtml")
    public String editWechatEvaluateHtml(Integer id ,Model model ){
           model.addAttribute("wechatEvaluate",wechatEvaluateService.selectWechatEvaluateByIdWechatEvaluate(id));
             return "wechatEvaluate/WechatEvaluateEdit";
    }

    /** 查看页面跳转
     * @param  id  前端传进的参数
     * @return 返回页面
     */
    @RequestMapping(value = "admin/showWechatEvaluateHtml")
    public String showWechatEvaluateHtml(Integer id ,Model model ){
           model.addAttribute("wechatEvaluate",wechatEvaluateService.selectWechatEvaluateByIdWechatEvaluate(id));
             return "wechatEvaluate/WechatEvaluateShow";
    }


    /** 分页查询WechatEvaluate
     * @param page  页码
     * @param limit  查几条
     * @param wechatEvaluate  前端传进的参数
     * @return 返回统一分页信息
     */
    @RequestMapping(value = "admin/findWechatEvaluateByPage")
    @ResponseBody
    public ResultPage findWechatEvaluateByPage(Integer page, Integer limit,WechatEvaluate wechatEvaluate){
             return wechatEvaluateService.findWechatEvaluateByPage(page,limit,wechatEvaluate);
    }

    /** 添加WechatEvaluate
     * @param wechatEvaluate  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/addWechatEvaluate")
    @ResponseBody
    public ApiResultModel saveWechatEvaluate(WechatEvaluate wechatEvaluate  ){
             return wechatEvaluateService.addWechatEvaluate(wechatEvaluate);
    }

    /** 编辑WechatEvaluate
     * @param wechatEvaluate  前端传进的参数
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/editWechatEvaluate")
    @ResponseBody
    public ApiResultModel editWechatEvaluate(WechatEvaluate wechatEvaluate  ){
             return wechatEvaluateService.editWechatEvaluate(wechatEvaluate);
    }



    /** 删除一条WechatEvaluate
     * @param id  前端传进的ID
     * @return 返回统一信息
     */
    @RequestMapping(value = "admin/delWechatEvaluate")
    @ResponseBody
    public ApiResultModel delWechatEvaluate( Integer id  ){
             return wechatEvaluateService.delWechatEvaluate(id);
    }


}
